import cv2
image=cv2.imread('sobel.png',cv2.IMREAD_GRAYSCALE)
Sobelx=cv2.Sobel(image,cv2.CV_64F,1,0)
Sobely=cv2.Sobel(image,cv2.CV_64F,0,1)
grad_x=cv2.convertScaleAbs(Sobelx)
grad_y=cv2.convertScaleAbs(Sobely)
Sobelxy=cv2.addWeighted(grad_x,0.5,grad_y,0.5,0)
cv2.imshow("Input",image)
cv2.imshow("Sobelx",Sobelx)
cv2.imshow("ScaleAbs",grad_x)
cv2.imshow("Sobel_y",Sobely)
cv2.imshow("ScaleAbs_y",grad_y)
cv2.imshow("Sobel",Sobelxy)
cv2.waitKey()
cv2.destroyAllWindows()




